
#ifndef READWRITE_ICON_H
#define READWRITE_ICON_H

#include <BReadWrite>

using namespace BWE;

#pragma pack(1)
struct IconHead
{
	short		idReserved;
	short		idType;
	short		idCount;
};

struct BmpHead
{
	unsigned char	width;
	unsigned char	height;
	unsigned char	colorCount;
	unsigned char	reserved;
	unsigned short	planes;
	unsigned short	bitCount;
	unsigned int	bytesInRes;
	unsigned int	imageOffset;
};
#pragma pack()

class ReadWrite_icon : public BReadWrite
{
public:
	ReadWrite_icon();
	~ReadWrite_icon();

	virtual void setOptions(const BString& options) override;
	virtual const BString& options() const override;

	virtual BObject* load(const BString& fileName) override;
	virtual bool load(const BString& fileName, BObject* object) override;
	virtual bool save(const BString& fileName, const BObject* object) const override;

	virtual BObject* read(const BBuffer& buffer) override;
	virtual bool read(const BBuffer& buffer, BObject* object) override;
	virtual bool write(BBuffer& buffer, const BObject* object) const override;

	virtual const BString& author() const override;
	virtual const BString& version() const override;
	virtual const BString& description() const override;
	virtual const BString& message() const override;

private:
	BString		_options;
	BString		_author;
	BString		_version;
	BString		_description;
	BString		_message;

};

#endif
